package br.com.infocruz.seam.crm.ejb.facade;

import java.util.List;

import br.com.infocruz.seam.crm.ejb.model.AbstractEntity;

public interface Facade<T extends AbstractEntity> {

    void create(T entity);

    void update(T entity);

    void remove(T entity);

    T find(Object id);

    List<T> findAll();

    List<T> findRange(Integer maxResults, Integer firstResult);
    
    List<T> findRange(Integer maxResults, Integer firstResult, String orderDirection, String orderColumn);
    
    List<T> findByExample(T exampleInstance);
    
	List<T> findByExample(T exampleInstance, String[] excludeProperty);
	
	List<T> findByExample(T exampleInstance, Integer maxResults, Integer firstResult, String[] excludeProperty);

	List<T> findByExample(T exampleInstance, Integer maxResults,
			Integer firstResult, String orderDirection, String orderColumn, String[] excludeProperty);

	Integer countByExample(T exampleInstance, String[] excludeProperty);
	
	int count();
	
	int count(String jpql);

	void refresh(T entity);

	void clearPersistenceContext();

}
